package com.viphuli.app.tool.common;

/**
 * 全局常量
 * 
 * @author li.li
 *
 */
public class Constants {

	/**
	 * 服务请求结果
	 */
	public static final int REQUEST_RESULT_STATUS_SUCCESS = 0;//返回状态 - 成功
	public final static int ACTIVITY_REQUEST_REFREASH_CODE = 4;//刷新当前页
	public static final int CIRCLE_NOT_EXSIST = -5007;//小组不存在

	public static final int ARRANGE_ACTION_TYPE_ARRANGE = 1;
	public static final int ARRANGE_ACTION_TYPE_EXCHANGE = 2;
	public static final int ARRANGE_ACTION_TYPE_REPLACE = 3;

	public static final int TIME_STAMP_LENGTH = 10;//时间戳长度
	
	public static final int ACTIVITY_REQUEST_HOSPITAL_SELECT_CODE = 1;
	public static final int ACTIVITY_REQUEST_DEPARTMENT_SELECT_CODE = 2;


	/**
	 * 用户类型
	 *
	 */
	public enum UserType {
		none(0, "未知"), //未知
		normal(21, "普通用户"), //普通用户
		arrange_admin(22, "排班管理员"), //排班管理员

		;

		private int value;
		private String name;

		private UserType(int value, String name) {
			this.value = value;
			this.name = name;
		}

		public int getValue() {
			return value;
		}

		public String getName() {
			return name;
		}

		public static UserType getType(int value) {

			for (UserType t : UserType.values()) {
				if (t.getValue() == value) {
					return t;
				}
			}

			return UserType.none;
		}

		public static UserType getType(String name) {

			for (UserType t : UserType.values()) {
				if (t.getName().equals(name)) {
					return t;
				}
			}

			return UserType.none;
		}

	}

	public enum ArrangeRecordType {
		none(0, "未知"), //未知
		arrange(1, "排班"), //
		arrange_cancel(2, "撤销排班"), //
		exchange(3, "换班"), //
		exchange_cancel(4, "撤销换班"), //
		replace(5, "替班"), //
		replace_cancel(6, "撤销替班"), //

		;

		private int value;
		private String name;

		private ArrangeRecordType(int value, String name) {
			this.value = value;
			this.name = name;
		}

		public int getValue() {
			return value;
		}

		public String getName() {
			return name;
		}

		public static ArrangeRecordType getType(int value) {

			for (ArrangeRecordType t : ArrangeRecordType.values()) {
				if (t.getValue() == value) {
					return t;
				}
			}

			return ArrangeRecordType.none;
		}

		public static ArrangeRecordType getType(String name) {

			for (ArrangeRecordType t : ArrangeRecordType.values()) {
				if (t.getName().equals(name)) {
					return t;
				}
			}

			return ArrangeRecordType.none;
		}
	}

	public enum ArrangeRecordStatus {
		none(0, "未知"), //未知
		wait_accept(1, "待通过"), //
		cancel(2, "已撤销"), //
		reject(3, "未通过"), //
		accept(4, "已通过"), //
		effect(5, "已生效"), //

		;

		private int value;
		private String name;

		private ArrangeRecordStatus(int value, String name) {
			this.value = value;
			this.name = name;
		}

		public int getValue() {
			return value;
		}

		public String getName() {
			return name;
		}

		public static ArrangeRecordStatus getStatus(int value) {

			for (ArrangeRecordStatus t : ArrangeRecordStatus.values()) {
				if (t.getValue() == value) {
					return t;
				}
			}

			return ArrangeRecordStatus.none;
		}

		public static ArrangeRecordStatus getStatus(String name) {

			for (ArrangeRecordStatus t : ArrangeRecordStatus.values()) {
				if (t.getName().equals(name)) {
					return t;
				}
			}

			return ArrangeRecordStatus.none;
		}
	}

	/**
	 * 在线参数
	 */
	public static final String ONLINE_PARAMS_KEY_SERVICE_TEL = "service_tel";

	/**
	 * 分享类型
	 */
	public enum ShareType {

		weichat_circle(1), //微信-朋友圈
		weichat(2), //微信

		;

		private int platform;

		private ShareType(int platform) {
			this.platform = platform;
		}

		public int getPlatform() {
			return platform;
		}
	}

}
